package com.lnu.information.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.lnu.information.dao.*;
import com.lnu.information.dao.company_listedcompany_handofviolationMapper;
import com.lnu.information.dto.QueryCompanyRequestDTO;
import com.lnu.information.entity.*;
import com.lnu.information.exception.QueryException;
import com.lnu.information.service.CompanyService;
import com.lnu.information.util.ClassUtil;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.lang.reflect.Constructor;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @author : jian.zhang-2
 * @description:
 * @date : Create in 1:40 PM 2022/2/18
 * @modified By :
 */
@Service
public class CompanyServiceImpl implements CompanyService {

    @Resource
    private CompanyMapper companyMapper;

    @Resource
    private CompanyListedcompanyEquityholdingMapper companyListedcompanyEquityholdingMapper;

    @Resource
    private CompanyListedcompanyDetailinforMapper companyListedCompanyDetailInforMapper;

    @Resource
    private CompanyListedcompanyToptencurrentshareholdersMapper companyListedcompanyToptencurrentshareholdersMapper;

    @Resource
    private Company_listedcompanyMapper company_listedcompanyMapper;

    @Resource
    private company_listedcompany_additionalissueMapper company_listedCompany_additionalIssueMapper;

    @Resource
    private company_listedcompany_allotmentconditionMapper company_listedCompany_allotmentConditionMapper;

    @Resource
    private company_listedcompany_dividendmatterMapper company_listedCompany_dividendMatterMapper;

    @Resource
    private company_listedcompany_equitytransferMapper company_listedCompany_equityTransferMapper;

    @Resource
    private Company_listedcompany_executiveholdingchangesMapper company_listedcompany_executiveholdingchangesMapper;

    @Resource
    private Company_listedcompany_executiveinforMapper company_listedcompany_executiveinforMapper;

    @Resource
    private company_listedcompany_fundraisingsourceMapper company_listedCompany_fundRaisingSourceMapper;

    @Resource
    private company_listedcompany_handofviolationMapper company_listedCompany_handofViolationMapper;

    @Resource
    private company_listedcompany_holdernumberMapper company_listedCompany_holdernumberMapper;

    @Resource
    private com.lnu.information.dao.company_listedcompany_institutionholddetailMapper company_listedcompany_institutionholddetailMapper;

    @Resource
    private company_listedcompany_institutionholdsummaryMapper company_listedCompany_institutionholdSummaryMapper;

    @Resource
    private company_listedcompany_ipoinstitutionMapper company_listedCompany_ipoInstitutionMapper;

    @Resource
    private company_listedcompany_issuerelatedEntityMapper company_listedCompany_issueRelatedMapper;

    @Resource
    private company_listedcompany_pledgethawMapper company_listedCompany_pledgethawMapper;

    @Resource
    private company_listedcompany_projectinvestmentMapper company_listedCompany_projectInvestmentMapper;

    @Resource
    private company_listedcompany_purchaseandmergersMapper company_listedCompany_purchaseandMergersMapper;

    @Resource
    private company_listedcompany_relatedtransactionsMapper company_listedCompany_relatedTransactionsMapper;

    @Resource
    private Company_listedcompany_toptencurrentshareholdersMapper company_listedcompany_toptencurrentshareholdersMapper;

    @Resource
    private ktggMapper ktggMapper;
    @Resource
    private manage_bidwinningMapper manage_bidwinningMapper;
    @Resource
    private manage_recruitMapper manage_recruitMapper;
    @Resource
    private overseas_investmentMapper overseas_investmentMapper;
    @Resource
    private prop_domain_websiteMapper prop_domain_websiteMapper;
    @Resource
    private legal_persons_subject_to_enforcementMapper legal_persons_subject_to_enforcementMapper;
    @Resource
    private qyxx_finalshareholderMapper qyxx_finalshareholderMapper;
    @Resource
    private qyxx_mordetailMapper qyxx_mordetailMapper;
    @Resource
    private qyxx_jqka_cwzb_yhzxMapper qyxx_jqka_cwzb_yhzxMapper;
    @Resource
    private qyxx_jyycMapper qyxx_jyycMapper;
    @Resource
    private qyxx_liquidationMapper qyxx_liquidationMapper;
    @Resource
    private manage_tenderMapper manage_tenderMapper;
    @Resource
    private qyxx_basicMapper qyxx_basicMapper;
    @Resource
    private qyxx_bgxx_merge_cleanMapper qyxx_bgxx_merge_cleanMapper;
    @Resource
    private qyxx_jqka_cwbdMapper qyxx_jqka_cwbdMapper;
    @Resource
    private qyxx_sharesfrostMapper qyxx_sharesfrostMapper;
    @Resource
    private legal_dishonest_persons_subject_to_enforcementMapper legal_dishonest_persons_subject_to_enforcementMapper;
    @Resource
    private qyxx_baxxMapper qyxx_baxxMapper;
    @Resource
    private qyxx_fzjg_mergeMapper qyxx_fzjg_mergeMapper;
    @Resource
    private qyxx_gdxxMapper qyxx_gdxxMapper;
    @Resource
    private qyxx_jqka_cwzb_xjllMapper qyxx_jqka_cwzb_xjllMapper;
    @Resource
    private qyxx_jqka_cwzb_zcfzMapper qyxx_jqka_cwzb_zcfzMapper;
    @Resource
    private qyxx_jqka_ipo_fxxgMapper qyxx_jqka_ipo_fxxgMapper;
    @Resource
    private qyxx_jqka_cwzb_zhsyMapper qyxx_jqka_cwzb_zhsyMapper;
    @Resource
    private qyxx_jqka_cwzb_zhzbMapper qyxx_jqka_cwzb_zhzbMapper;
    @Resource
    private qyxx_jqka_ipo_basicMapper qyxx_jqka_ipo_basicMapper;
    @Resource
    private qyxx_sharesimpawnMapper qyxx_sharesimpawnMapper;
    @Resource
    private qyxx_wanfang_zhuanliMapper qyxx_wanfang_zhuanliMapper;
    @Resource
    private risk_punishmentMapper risk_punishmentMapper;
    @Resource
    private risk_tax_owedMapper risk_tax_owedMapper;
    @Resource
    private xgxx_shangbiaoMapper xgxx_shangbiaoMapper;

    @Override
    public Map queryTableData(String tableName, QueryCompanyRequestDTO queryCompanyRequestDTO) {
        String[] request = getRequestParam(tableName, queryCompanyRequestDTO);
        Object targetEntity;
        try {
            targetEntity = createObject(tableName, request);
        } catch (Exception e) {
            throw new QueryException(QueryException.QueryExceptionEnum.ILLEGAL_PARAM_EXCEPTION).newInstance("不能为空");
        }
        return findEntityAndQuery(targetEntity, request[0]);
    }

    //通过表名校验参数
    public static String[] getRequestParam(String tableName, QueryCompanyRequestDTO queryCompanyRequestDTO) {
        if("company".equals(tableName)){
            return new String[] {queryCompanyRequestDTO.getCompanyName()};
        }else if("company_listedcompany_equityholding".equals(tableName)){
            return new String[] {queryCompanyRequestDTO.getCompanyName()};
        }else if("company_listedcompany_detailinfor".equals(tableName)){
            return new String[] {queryCompanyRequestDTO.getCompany_listedCompany_detailInfor_FullName()};
        }else if("company_listedcompany".equals(tableName)){
            return new String[] {queryCompanyRequestDTO.getCompanyId()};
        }else if("company_listedcompany_additionalissue".equals(tableName)){
            return new String[] {queryCompanyRequestDTO.getCompany_listedCompany_additionalIssue_FullName()};
        }else if("company_listedcompany_allotmentcondition".equals(tableName)){
            return new String[] {queryCompanyRequestDTO.getCompany_listedCompany_allotmentCondition_FullName()};
        }else if("company_listedcompany_dividendmatter".equals(tableName)){
            return new String[] {queryCompanyRequestDTO.getCompany_listedCompany_dividendMatter_FullName()};
        }else if("company_listedcompany_equitytransfer".equals(tableName)){
            return new String[] {queryCompanyRequestDTO.getCompany_listedCompany_equityTransfer_FullName()};
        }else if("company_listedcompany_executiveholdingchanges".equals(tableName)){
            return new String[] {queryCompanyRequestDTO.getCompany_listedCompany_executiveholdingchanges_FullName()};
        }else if("company_listedcompany_executiveinfor".equals(tableName)){
            return new String[] {queryCompanyRequestDTO.getCompany_listedCompany_executiveInfor_FullName()};
        }else if("company_listedcompany_fundraisingsource".equals(tableName)){
            return new String[] {queryCompanyRequestDTO.getCompany_listedCompany_fundRaisingSource_FullName()};
        }else if("company_listedcompany_handofviolation".equals(tableName)){
            return new String[] {queryCompanyRequestDTO.getCompany_listedCompany_handofViolation_FullName()};
        }else if("company_listedcompany_holderholdingchanges".equals(tableName)){
            return new String[] {queryCompanyRequestDTO.getCompany_listedCompany_holderholdingchanges_FullName()};
        }else if("company_listedcompany_holdernumber".equals(tableName)){
            return new String[] {queryCompanyRequestDTO.getCompanyId()};
        }else if("company_listedcompany_institutionholddetail".equals(tableName)){
            return new String[] {queryCompanyRequestDTO.getCompany_listedCompany_institutionholdDetail_FullName()};
        }else if("company_listedcompany_institutionholdsummary".equals(tableName)){
            return new String[] {queryCompanyRequestDTO.getCompany_listedCompany_institutionholdSummary_FullName()};
        }else if("company_listedcompany_ipoinstitution".equals(tableName)){
            return new String[] {queryCompanyRequestDTO.getCompany_listedCompany_ipoInstitution_organizationName()};
        }else if("company_listedcompany_issuerelated".equals(tableName)){
            return new String[] {queryCompanyRequestDTO.getCompany_listedCompany_issueRelated_FullName()};
        }else if("company_listedcompany_pledgethaw".equals(tableName)){
            return new String[] {queryCompanyRequestDTO.getCompanyId()};
        }else if("company_listedcompany_projectinvestment".equals(tableName)){
            return new String[] {queryCompanyRequestDTO.getCompany_listedCompany_projectInvestment_FullName()};
        }else if("company_listedcompany_purchaseandmergers".equals(tableName)){
            return new String[] {queryCompanyRequestDTO.getCompany_listedCompany_purchaseandMergers_FullName()};
        }else if("company_listedcompany_relatedtransactions".equals(tableName)){
            return new String[] {queryCompanyRequestDTO.getCompany_listedCompany_relatedTransactions_FullName()};
        }else if("company_listedcompany_toptencurrentshareholders".equals(tableName)){
            return new String[] {queryCompanyRequestDTO.getCompany_listedCompany_topTenCurrentShareholders_FullName()};
        }
        //bbd
        else if("ktgg".equals(tableName)){
            return new String[] {queryCompanyRequestDTO.getAccuser()};
        }else if("legal_dishonest_persons_subject_to_enforcement".equals(tableName)){
            return new String[] {queryCompanyRequestDTO.getCompanyName()};
        }else if("legal_persons_subject_to_enforcement".equals(tableName)){
            return new String[] {queryCompanyRequestDTO.getPname()};
        }else if("manage_bidwinning".equals(tableName)){
            return new String[] {queryCompanyRequestDTO.getCompanyName()};
        }else if("manage_recruit".equals(tableName)){
            return new String[] {queryCompanyRequestDTO.getCompanyName()};
        }else if("overseas_investment".equals(tableName)){
            return new String[] {queryCompanyRequestDTO.getDomesticInvestSubject()};
        }else if("prop_domain_website".equals(tableName)){
            return new String[] {queryCompanyRequestDTO.getOrganizerName()};
        }else if("qyxx_finalshareholder".equals(tableName)){
            return new String[] {queryCompanyRequestDTO.getCompanyName()};
        }else if("qyxx_jqka_cwzb_yhzx".equals(tableName)){
            return new String[] {queryCompanyRequestDTO.getCompanyName()};
        }else if("qyxx_mordetail".equals(tableName)){
            return new String[] {queryCompanyRequestDTO.getCompanyName()};
        }else if("qyxx_jyyc".equals(tableName)){
            return new String[] {queryCompanyRequestDTO.getCompanyName()};
        }else if("qyxx_liquidation".equals(tableName)){
            return new String[] {queryCompanyRequestDTO.getCompanyName()};
        }else if("manage_tender".equals(tableName)){
            return new String[] {queryCompanyRequestDTO.getCompanyName()};
        }else if("qyxx_basic".equals(tableName)){
            return new String[] {queryCompanyRequestDTO.getCompanyName()};
        }else if("qyxx_bgxx_merge_clean".equals(tableName)){
            return new String[] {queryCompanyRequestDTO.getCompanyName()};
        }else if("qyxx_sharesfrost".equals(tableName)){
            return new String[] {queryCompanyRequestDTO.getCompanyName()};
        }else if("qyxx_baxx".equals(tableName)){
            return new String[] {queryCompanyRequestDTO.getName()};
        }else if("qyxx_fzjg_merge".equals(tableName)){
            return new String[] {queryCompanyRequestDTO.getCompanyName()};
        }else if("qyxx_gdxx".equals(tableName)){
            return new String[] {queryCompanyRequestDTO.getShareholderName()};
        }else if("qyxx_jqka_cwzb_xjll".equals(tableName)){
            return new String[] {queryCompanyRequestDTO.getCompanyName()};
        }else if("qyxx_jqka_ipo_fxxg".equals(tableName)){
            return new String[] {queryCompanyRequestDTO.getCompanyName()};
        }else if("qyxx_jqka_cwzb_zhsyMapper".equals(tableName)){
            return new String[] {queryCompanyRequestDTO.getCompanyName()};
        }else if("qyxx_jqka_cwzb_zhzb".equals(tableName)){
            return new String[] {queryCompanyRequestDTO.getCompanyName()};
        }else if("qyxx_jqka_ipo_basic".equals(tableName)){
            return new String[] {queryCompanyRequestDTO.getCompanyName()};
        }else if("qyxx_sharesimpawn".equals(tableName)){
            return new String[] {queryCompanyRequestDTO.getCompanyName()};
        }else if("qyxx_wanfang_zhuanli".equals(tableName)){
            return new String[] {queryCompanyRequestDTO.getCompanyName()};
        }else if("risk_tax_owed".equals(tableName)){
            return new String[] {queryCompanyRequestDTO.getCompanyName()};
        }else if("xgxx_shangbiao".equals(tableName)){
            return new String[] {queryCompanyRequestDTO.getApplicantName()};
        } else if("qyxx_jqka_cwbd".equals(tableName)){
            return new String[] {queryCompanyRequestDTO.getCompanyName()};
        } else if("qyxx_jqka_cwzb_zcfz".equals(tableName)){
            return new String[] {queryCompanyRequestDTO.getCompanyName()};
        } else if("qyxx_jqka_cwzb_zhsy".equals(tableName)){
            return new String[] {queryCompanyRequestDTO.getCompanyName()};
        } else if("risk_punishment".equals(tableName)){
            return new String[] {queryCompanyRequestDTO.getCompanyName()};
        }else {
            throw new QueryException(QueryException.QueryExceptionEnum.TABLE_NOT_EXIST).newInstance("不能为空");
        }
    }

    /***
     * 通过反射创建带参数的对象
     * @param classPath
     * @param params
     * @return
     * @throws Exception
     */
    public Object createObject(String classPath, Object[] params) throws Exception {
        Class<?> demo = null;
        Object obj = null;
        demo = Class.forName("com.lnu.information.entity." + classPath + "Entity");
        if (params != null) {
            Class[] argsClass = new Class[params.length];
            for (int i = 0, j = params.length; i < j; i++) {
                argsClass[i] = params[i].getClass();
            }
            Constructor cons = demo.getConstructor(argsClass);
            obj = cons.newInstance(params);
        } else {
            obj = demo.newInstance();
        }
        return obj;
    }

    /***
     *
     * @param targetEntity
     * @param request
     */
    private Map<String, Object> findEntityAndQuery(Object targetEntity, String request) {
        Map<String,Object> result = new HashMap<>();
        if(targetEntity instanceof company_listedcompany_detailinforEntity) {
            QueryWrapper<company_listedcompany_detailinforEntity> queryWrapper = new QueryWrapper<>();
            //参数为表中的列名，要查询的条件 相当于 WHERE name = name
            queryWrapper.eq("company_listedcompany_detailinfor_name", request);
            return ClassUtil.setConditionMap(companyListedCompanyDetailInforMapper.selectOne(queryWrapper));
        }else if(targetEntity instanceof companyEntity){
            QueryWrapper<companyEntity> queryWrapper = new QueryWrapper<>();
            //参数为表中的列名，要查询的条件 相当于 WHERE name = name
            queryWrapper.eq("company_name", request);
            List<companyEntity> resultList = companyMapper.selectList(queryWrapper);
            if(resultList.size() == 0){
                throw new QueryException(QueryException.QueryExceptionEnum.DATA_NOT_EXIST_EXCEPTION);
            }
            result.put("company",resultList);
            return result;
        }else if(targetEntity instanceof company_listedcompany_equityholdingEntity){
            QueryWrapper<company_listedcompany_equityholdingEntity> queryWrapper = new QueryWrapper<>();
            //参数为表中的列名，要查询的条件 相当于 WHERE name = name
            queryWrapper.eq("company_listedcompany_equityholding", request);
            List<company_listedcompany_equityholdingEntity> resultList = companyListedcompanyEquityholdingMapper.selectList(queryWrapper);
            if(resultList.size() == 0){
                throw new QueryException(QueryException.QueryExceptionEnum.DATA_NOT_EXIST_EXCEPTION);
            }
            result.put("company_listedcompany_equityholding",resultList);
            return result;
        }else if(targetEntity instanceof company_listedcompanyEntity){
            QueryWrapper<company_listedcompanyEntity> queryWrapper = new QueryWrapper<>();
            //参数为表中的列名，要查询的条件 相当于 WHERE name = name
            queryWrapper.eq("company_id", request);
            List<company_listedcompanyEntity> resultList = company_listedcompanyMapper.selectList(queryWrapper);
            if(resultList.size() == 0){
                throw new QueryException(QueryException.QueryExceptionEnum.DATA_NOT_EXIST_EXCEPTION);
            }
            result.put("company_listedcompany",resultList);
            return result;
        }else if(targetEntity instanceof company_listedcompany_additionalissueEntity){
            QueryWrapper<company_listedcompany_additionalissueEntity> queryWrapper = new QueryWrapper<>();
            //参数为表中的列名，要查询的条件 相当于 WHERE name = name
            queryWrapper.eq("company_listedCompany_additionalIssue_FullName", request);
            List<company_listedcompany_additionalissueEntity> resultList = company_listedCompany_additionalIssueMapper.selectList(queryWrapper);
            if(resultList.size() == 0){
                throw new QueryException(QueryException.QueryExceptionEnum.DATA_NOT_EXIST_EXCEPTION);
            }
            result.put("company_listedcompany_additionalissue",resultList);
            return result;
        }else if(targetEntity instanceof company_listedcompany_allotmentconditionEntity){
            QueryWrapper<company_listedcompany_allotmentconditionEntity> queryWrapper = new QueryWrapper<>();
            //参数为表中的列名，要查询的条件 相当于 WHERE name = name
            queryWrapper.eq("company_listedCompany_allotmentCondition_FullName", request);
            List<company_listedcompany_allotmentconditionEntity> resultList = company_listedCompany_allotmentConditionMapper.selectList(queryWrapper);
            if(resultList.size() == 0){
                throw new QueryException(QueryException.QueryExceptionEnum.DATA_NOT_EXIST_EXCEPTION);
            }
            result.put("company_listedcompany_allotmentcondition",resultList);
            return result;
        }else if(targetEntity instanceof company_listedcompany_dividendmatterEntity){
            QueryWrapper<company_listedcompany_dividendmatterEntity> queryWrapper = new QueryWrapper<>();
            //参数为表中的列名，要查询的条件 相当于 WHERE name = name
            queryWrapper.eq("company_listedCompany_dividendMatter_FullName", request);
            List<company_listedcompany_dividendmatterEntity> resultList = company_listedCompany_dividendMatterMapper.selectList(queryWrapper);
            if(resultList.size() == 0){
                throw new QueryException(QueryException.QueryExceptionEnum.DATA_NOT_EXIST_EXCEPTION);
            }
            result.put("company_listedcompany_dividendmatter",resultList);
            return result;
        }else if(targetEntity instanceof company_listedcompany_equitytransferEntity){
            QueryWrapper<company_listedcompany_equitytransferEntity> queryWrapper = new QueryWrapper<>();
            //参数为表中的列名，要查询的条件 相当于 WHERE name = name
            queryWrapper.eq("company_listedCompany_equityTransfer_FullName", request);
            List<company_listedcompany_equitytransferEntity> resultList = company_listedCompany_equityTransferMapper.selectList(queryWrapper);
            if(resultList.size() == 0){
                throw new QueryException(QueryException.QueryExceptionEnum.DATA_NOT_EXIST_EXCEPTION);
            }
            result.put("company_listedcompany_equitytransfer",resultList);
            return result;
        }else if(targetEntity instanceof company_listedcompany_executiveholdingchangesEntity){
            QueryWrapper<company_listedcompany_executiveholdingchangesEntity> queryWrapper = new QueryWrapper<>();
            //参数为表中的列名，要查询的条件 相当于 WHERE name = name
            queryWrapper.eq("company_listedCompany_executiveholdingchanges_FullName", request);
            List<company_listedcompany_executiveholdingchangesEntity> resultList = company_listedcompany_executiveholdingchangesMapper.selectList(queryWrapper);
            if(resultList.size() == 0){
                throw new QueryException(QueryException.QueryExceptionEnum.DATA_NOT_EXIST_EXCEPTION);
            }
            result.put("company_listedcompany_executiveholdingchanges",resultList);
            return result;
        }else if(targetEntity instanceof company_listedcompany_executiveinforEntity){
            QueryWrapper<company_listedcompany_executiveinforEntity> queryWrapper = new QueryWrapper<>();
            //参数为表中的列名，要查询的条件 相当于 WHERE name = name
            queryWrapper.eq("company_listedCompany_executiveInfor_FullName", request);
            List<company_listedcompany_executiveinforEntity> resultList = company_listedcompany_executiveinforMapper.selectList(queryWrapper);
            if(resultList.size() == 0){
                throw new QueryException(QueryException.QueryExceptionEnum.DATA_NOT_EXIST_EXCEPTION);
            }
            result.put("company_listedcompany_executiveinfor",resultList);
            return result;
        }else if(targetEntity instanceof company_listedcompany_fundraisingsourceEntity){
            QueryWrapper<company_listedcompany_fundraisingsourceEntity> queryWrapper = new QueryWrapper<>();
            //参数为表中的列名，要查询的条件 相当于 WHERE name = name
            queryWrapper.eq("company_listedCompany_fundRaisingSource_FullName", request);
            List<company_listedcompany_fundraisingsourceEntity> resultList = company_listedCompany_fundRaisingSourceMapper.selectList(queryWrapper);
            if(resultList.size() == 0){
                throw new QueryException(QueryException.QueryExceptionEnum.DATA_NOT_EXIST_EXCEPTION);
            }
            result.put("company_listedcompany_fundraisingsource",resultList);
            return result;
        }else if(targetEntity instanceof company_listedcompany_handofviolationEntity){
            QueryWrapper<company_listedcompany_handofviolationEntity> queryWrapper = new QueryWrapper<>();
            //参数为表中的列名，要查询的条件 相当于 WHERE name = name
            queryWrapper.eq("company_listedCompany_handofViolation_FullName", request);
            List<company_listedcompany_handofviolationEntity> resultList = company_listedCompany_handofViolationMapper.selectList(queryWrapper);
            if(resultList.size() == 0){
                throw new QueryException(QueryException.QueryExceptionEnum.DATA_NOT_EXIST_EXCEPTION);
            }
            result.put("company_listedcompany_handofviolation",resultList);
            return result;
        }else if(targetEntity instanceof company_listedcompany_holdernumberEntity){
            QueryWrapper<company_listedcompany_holdernumberEntity> queryWrapper = new QueryWrapper<>();
            //参数为表中的列名，要查询的条件 相当于 WHERE name = name
            queryWrapper.eq("company_id", request);
            List<company_listedcompany_holdernumberEntity> resultList = company_listedCompany_holdernumberMapper.selectList(queryWrapper);
            if(resultList.size() == 0){
                throw new QueryException(QueryException.QueryExceptionEnum.DATA_NOT_EXIST_EXCEPTION);
            }
            result.put("company_listedcompany_holdernumber",resultList);
            return result;
        }else if(targetEntity instanceof company_listedcompany_institutionholddetailEntity){
            QueryWrapper<company_listedcompany_institutionholddetailEntity> queryWrapper = new QueryWrapper<>();
            //参数为表中的列名，要查询的条件 相当于 WHERE name = name
            queryWrapper.eq("company_listedCompany_institutionholdDetail_FullName", request);
            List<company_listedcompany_institutionholddetailEntity> resultList = company_listedcompany_institutionholddetailMapper.selectList(queryWrapper);
            if(resultList.size() == 0){
                throw new QueryException(QueryException.QueryExceptionEnum.DATA_NOT_EXIST_EXCEPTION);
            }
            result.put("company_listedcompany_institutionholddetail",resultList);
            return result;
        }else if(targetEntity instanceof company_listedcompany_institutionholdsummaryEntity){
            QueryWrapper<company_listedcompany_institutionholdsummaryEntity> queryWrapper = new QueryWrapper<>();
            //参数为表中的列名，要查询的条件 相当于 WHERE name = name
            queryWrapper.eq("company_listedCompany_institutionholdSummary_FullName", request);
            List<company_listedcompany_institutionholdsummaryEntity> resultList = company_listedCompany_institutionholdSummaryMapper.selectList(queryWrapper);
            if(resultList.size() == 0){
                throw new QueryException(QueryException.QueryExceptionEnum.DATA_NOT_EXIST_EXCEPTION);
            }
            result.put("company_listedcompany_institutionholdsummary",resultList);
            return result;
        }else if(targetEntity instanceof company_listedcompany_ipoinstitutionEntity){
            QueryWrapper<company_listedcompany_ipoinstitutionEntity> queryWrapper = new QueryWrapper<>();
            //参数为表中的列名，要查询的条件 相当于 WHERE name = name
            queryWrapper.eq("company_listedCompany_ipoInstitution_organizationName", request);
            List<company_listedcompany_ipoinstitutionEntity> resultList = company_listedCompany_ipoInstitutionMapper.selectList(queryWrapper);
            if(resultList.size() == 0){
                throw new QueryException(QueryException.QueryExceptionEnum.DATA_NOT_EXIST_EXCEPTION);
            }
            result.put("company_listedcompany_ipoinstitution",resultList);
            return result;
        }else if(targetEntity instanceof company_listedcompany_issuerelatedEntity){
            QueryWrapper<company_listedcompany_issuerelatedEntity> queryWrapper = new QueryWrapper<>();
            //参数为表中的列名，要查询的条件 相当于 WHERE name = name
            queryWrapper.eq("company_listedCompany_issueRelated_FullName", request);
            List<company_listedcompany_issuerelatedEntity> resultList = company_listedCompany_issueRelatedMapper.selectList(queryWrapper);
            if(resultList.size() == 0){
                throw new QueryException(QueryException.QueryExceptionEnum.DATA_NOT_EXIST_EXCEPTION);
            }
            result.put("company_listedcompany_issuerelated",resultList);
            return result;
        }else if(targetEntity instanceof company_listedcompany_pledgethawEntity){
            QueryWrapper<company_listedcompany_pledgethawEntity> queryWrapper = new QueryWrapper<>();
            //参数为表中的列名，要查询的条件 相当于 WHERE name = name
            queryWrapper.eq("company_id", request);
            List<company_listedcompany_pledgethawEntity> resultList = company_listedCompany_pledgethawMapper.selectList(queryWrapper);
            if(resultList.size() == 0){
                throw new QueryException(QueryException.QueryExceptionEnum.DATA_NOT_EXIST_EXCEPTION);
            }
            result.put("company_listedcompany_pledgethaw",resultList);
            return result;
        }else if(targetEntity instanceof company_listedcompany_projectinvestmentEntity){
            QueryWrapper<company_listedcompany_projectinvestmentEntity> queryWrapper = new QueryWrapper<>();
            //参数为表中的列名，要查询的条件 相当于 WHERE name = name
            queryWrapper.eq("company_listedCompany_projectInvestment_FullName", request);
            List<company_listedcompany_projectinvestmentEntity> resultList = company_listedCompany_projectInvestmentMapper.selectList(queryWrapper);
            if(resultList.size() == 0){
                throw new QueryException(QueryException.QueryExceptionEnum.DATA_NOT_EXIST_EXCEPTION);
            }
            result.put("company_listedcompany_projectinvestment",resultList);
            return result;
        }else if(targetEntity instanceof company_listedcompany_purchaseandmergersEntity){
            QueryWrapper<company_listedcompany_purchaseandmergersEntity> queryWrapper = new QueryWrapper<>();
            //参数为表中的列名，要查询的条件 相当于 WHERE name = name
            queryWrapper.eq("company_listedCompany_purchaseandMergers_FullName", request);
            List<company_listedcompany_purchaseandmergersEntity> resultList = company_listedCompany_purchaseandMergersMapper.selectList(queryWrapper);
            if(resultList.size() == 0){
                throw new QueryException(QueryException.QueryExceptionEnum.DATA_NOT_EXIST_EXCEPTION);
            }
            result.put("company_listedcompany_purchaseandmergers",resultList);
            return result;
        }else if(targetEntity instanceof company_listedcompany_relatedtransactionsEntity){
            QueryWrapper<company_listedcompany_relatedtransactionsEntity> queryWrapper = new QueryWrapper<>();
            //参数为表中的列名，要查询的条件 相当于 WHERE name = name
            queryWrapper.eq("company_listedCompany_relatedTransactions_FullName", request);
            List<company_listedcompany_relatedtransactionsEntity> resultList = company_listedCompany_relatedTransactionsMapper.selectList(queryWrapper);
            if(resultList.size() == 0){
                throw new QueryException(QueryException.QueryExceptionEnum.DATA_NOT_EXIST_EXCEPTION);
            }
            result.put("company_listedcompany_relatedtransactions",resultList);
            return result;
        }else if(targetEntity instanceof company_listedcompany_toptencurrentshareholdersEntity){
            QueryWrapper<company_listedcompany_toptencurrentshareholdersEntity> queryWrapper = new QueryWrapper<>();
            //参数为表中的列名，要查询的条件 相当于 WHERE name = name
            queryWrapper.eq("company_listedCompany_topTenCurrentShareholders_FullName", request);
            List<company_listedcompany_toptencurrentshareholdersEntity> resultList = company_listedcompany_toptencurrentshareholdersMapper.selectList(queryWrapper);
            if(resultList.size() == 0){
                throw new QueryException(QueryException.QueryExceptionEnum.DATA_NOT_EXIST_EXCEPTION);
            }
            result.put("company_listedcompany_toptencurrentshareholders",resultList);
            return result;
        }

        //bbd
        else if(targetEntity instanceof ktggEntity){
            QueryWrapper<ktggEntity> queryWrapper = new QueryWrapper<>();
            //参数为表中的列名，要查询的条件 相当于 WHERE name = name
            queryWrapper.eq("accuser", request);
            List<ktggEntity> resultList = ktggMapper.selectList(queryWrapper);
            if(resultList.size() == 0){
                throw new QueryException(QueryException.QueryExceptionEnum.DATA_NOT_EXIST_EXCEPTION);
            }
            result.put("ktgg",resultList);
            return result;
        }else if(targetEntity instanceof legal_persons_subject_to_enforcementEntity){
            QueryWrapper<legal_persons_subject_to_enforcementEntity> queryWrapper = new QueryWrapper<>();
            //参数为表中的列名，要查询的条件 相当于 WHERE name = name
            queryWrapper.eq("pname", request);
            List<legal_persons_subject_to_enforcementEntity> resultList = legal_persons_subject_to_enforcementMapper.selectList(queryWrapper);
            if(resultList.size() == 0){
                throw new QueryException(QueryException.QueryExceptionEnum.DATA_NOT_EXIST_EXCEPTION);
            }
            result.put("legal_persons_subject_to_enforcement",resultList);
            return result;
        }else if(targetEntity instanceof manage_bidwinningEntity){
            QueryWrapper<manage_bidwinningEntity> queryWrapper = new QueryWrapper<>();
            //参数为表中的列名，要查询的条件 相当于 WHERE name = name
            queryWrapper.eq("company_name_win", request);
            List<manage_bidwinningEntity> resultList = manage_bidwinningMapper.selectList(queryWrapper);
            if(resultList.size() == 0){
                throw new QueryException(QueryException.QueryExceptionEnum.DATA_NOT_EXIST_EXCEPTION);
            }
            result.put("manage_bidwinning",resultList);
            return result;
        }else if(targetEntity instanceof manage_recruitEntity){
            QueryWrapper<manage_recruitEntity> queryWrapper = new QueryWrapper<>();
            //参数为表中的列名，要查询的条件 相当于 WHERE name = name
            queryWrapper.eq("company_name", request);
            List<manage_recruitEntity> resultList = manage_recruitMapper.selectList(queryWrapper);
            if(resultList.size() == 0){
                throw new QueryException(QueryException.QueryExceptionEnum.DATA_NOT_EXIST_EXCEPTION);
            }
            result.put("manage_recruit",resultList);
            return result;
        }else if(targetEntity instanceof overseas_investmentEntity){
            QueryWrapper<overseas_investmentEntity> queryWrapper = new QueryWrapper<>();
            //参数为表中的列名，要查询的条件 相当于 WHERE name = name
            queryWrapper.eq("domestic_invest_subject", request);
            List<overseas_investmentEntity> resultList = overseas_investmentMapper.selectList(queryWrapper);
            if(resultList.size() == 0){
                throw new QueryException(QueryException.QueryExceptionEnum.DATA_NOT_EXIST_EXCEPTION);
            }
            result.put("overseas_investment",resultList);
            return result;
        }else if(targetEntity instanceof prop_domain_websiteEntity){
            QueryWrapper<prop_domain_websiteEntity> queryWrapper = new QueryWrapper<>();
            //参数为表中的列名，要查询的条件 相当于 WHERE name = name
            queryWrapper.eq("organizer_name", request);
            List<prop_domain_websiteEntity> resultList = prop_domain_websiteMapper.selectList(queryWrapper);
            if(resultList.size() == 0){
                throw new QueryException(QueryException.QueryExceptionEnum.DATA_NOT_EXIST_EXCEPTION);
            }
            result.put("prop_domain_website",resultList);
            return result;
        }else if(targetEntity instanceof qyxx_finalshareholderEntity){
            QueryWrapper<qyxx_finalshareholderEntity> queryWrapper = new QueryWrapper<>();
            //参数为表中的列名，要查询的条件 相当于 WHERE name = name
            queryWrapper.eq("company_name", request);
            List<qyxx_finalshareholderEntity> resultList = qyxx_finalshareholderMapper.selectList(queryWrapper);
            if(resultList.size() == 0){
                throw new QueryException(QueryException.QueryExceptionEnum.DATA_NOT_EXIST_EXCEPTION);
            }
            result.put("qyxx_finalshareholder",resultList);
            return result;
        }else if(targetEntity instanceof qyxx_jqka_cwzb_yhzxEntity){
            QueryWrapper<qyxx_jqka_cwzb_yhzxEntity> queryWrapper = new QueryWrapper<>();
            //参数为表中的列名，要查询的条件 相当于 WHERE name = name
            queryWrapper.eq("company_name", request);
            List<qyxx_jqka_cwzb_yhzxEntity> resultList = qyxx_jqka_cwzb_yhzxMapper.selectList(queryWrapper);
            if(resultList.size() == 0){
                throw new QueryException(QueryException.QueryExceptionEnum.DATA_NOT_EXIST_EXCEPTION);
            }
            result.put("qyxx_jqka_cwzb_yhzx",resultList);
            return result;
        }else if(targetEntity instanceof qyxx_mordetailEntity){
            QueryWrapper<qyxx_mordetailEntity> queryWrapper = new QueryWrapper<>();
            //参数为表中的列名，要查询的条件 相当于 WHERE name = name
            queryWrapper.eq("company_name", request);
            List<qyxx_mordetailEntity> resultList = qyxx_mordetailMapper.selectList(queryWrapper);
            if(resultList.size() == 0){
                throw new QueryException(QueryException.QueryExceptionEnum.DATA_NOT_EXIST_EXCEPTION);
            }
            result.put("qyxx_mordetail",resultList);
            return result;
        }else if(targetEntity instanceof qyxx_jyycEntity){
            QueryWrapper<qyxx_jyycEntity> queryWrapper = new QueryWrapper<>();
            //参数为表中的列名，要查询的条件 相当于 WHERE name = name
            queryWrapper.eq("company_name", request);
            List<qyxx_jyycEntity> resultList = qyxx_jyycMapper.selectList(queryWrapper);
            if(resultList.size() == 0){
                throw new QueryException(QueryException.QueryExceptionEnum.DATA_NOT_EXIST_EXCEPTION);
            }
            result.put("qyxx_jyyc",resultList);
            return result;
        }else if(targetEntity instanceof qyxx_liquidationEntity){
            QueryWrapper<qyxx_liquidationEntity> queryWrapper = new QueryWrapper<>();
            //参数为表中的列名，要查询的条件 相当于 WHERE name = name
            queryWrapper.eq("company_name", request);
            List<qyxx_liquidationEntity> resultList = qyxx_liquidationMapper.selectList(queryWrapper);
            if(resultList.size() == 0){
                throw new QueryException(QueryException.QueryExceptionEnum.DATA_NOT_EXIST_EXCEPTION);
            }
            result.put("qyxx_liquidation",resultList);
            return result;
        }else if(targetEntity instanceof manage_tenderEntity){
            QueryWrapper<manage_tenderEntity> queryWrapper = new QueryWrapper<>();
            //参数为表中的列名，要查询的条件 相当于 WHERE name = name
            queryWrapper.eq("company_name_invite", request);
            List<manage_tenderEntity> resultList = manage_tenderMapper.selectList(queryWrapper);
            if(resultList.size() == 0){
                throw new QueryException(QueryException.QueryExceptionEnum.DATA_NOT_EXIST_EXCEPTION);
            }
            result.put("manage_tender",resultList);
            return result;
        }else if(targetEntity instanceof qyxx_basicEntity){
            QueryWrapper<qyxx_basicEntity> queryWrapper = new QueryWrapper<>();
            //参数为表中的列名，要查询的条件 相当于 WHERE name = name
            queryWrapper.eq("company_name", request);
            List<qyxx_basicEntity> resultList = qyxx_basicMapper.selectList(queryWrapper);
            if(resultList.size() == 0){
                throw new QueryException(QueryException.QueryExceptionEnum.DATA_NOT_EXIST_EXCEPTION);
            }
            result.put("qyxx_basic",resultList);
            return result;
        }else if(targetEntity instanceof qyxx_bgxx_merge_cleanEntity){
            QueryWrapper<qyxx_bgxx_merge_cleanEntity> queryWrapper = new QueryWrapper<>();
            //参数为表中的列名，要查询的条件 相当于 WHERE name = name
            queryWrapper.eq("company_name", request);
            List<qyxx_bgxx_merge_cleanEntity> resultList = qyxx_bgxx_merge_cleanMapper.selectList(queryWrapper);
            if(resultList.size() == 0){
                throw new QueryException(QueryException.QueryExceptionEnum.DATA_NOT_EXIST_EXCEPTION);
            }
            result.put("qyxx_bgxx_merge_clean",resultList);
            return result;
        }else if(targetEntity instanceof qyxx_jqka_cwbdEntity){
            QueryWrapper<qyxx_jqka_cwbdEntity> queryWrapper = new QueryWrapper<>();
            //参数为表中的列名，要查询的条件 相当于 WHERE name = name
            queryWrapper.eq("company_name", request);
            List<qyxx_jqka_cwbdEntity> resultList = qyxx_jqka_cwbdMapper.selectList(queryWrapper);
            if(resultList.size() == 0){
                throw new QueryException(QueryException.QueryExceptionEnum.DATA_NOT_EXIST_EXCEPTION);
            }
            result.put("qyxx_jqka_cwbd",resultList);
            return result;
        }else if(targetEntity instanceof qyxx_sharesfrostEntity){
            QueryWrapper<qyxx_sharesfrostEntity> queryWrapper = new QueryWrapper<>();
            //参数为表中的列名，要查询的条件 相当于 WHERE name = name
            queryWrapper.eq("company_name", request);
            List<qyxx_sharesfrostEntity> resultList = qyxx_sharesfrostMapper.selectList(queryWrapper);
            if(resultList.size() == 0){
                throw new QueryException(QueryException.QueryExceptionEnum.DATA_NOT_EXIST_EXCEPTION);
            }
            result.put("qyxx_sharesfrost",resultList);
            return result;
        }else if(targetEntity instanceof legal_dishonest_persons_subject_to_enforcementEntity){
            QueryWrapper<legal_dishonest_persons_subject_to_enforcementEntity> queryWrapper = new QueryWrapper<>();
            //参数为表中的列名，要查询的条件 相当于 WHERE name = name
            queryWrapper.eq("pname", request);
            List<legal_dishonest_persons_subject_to_enforcementEntity> resultList = legal_dishonest_persons_subject_to_enforcementMapper.selectList(queryWrapper);
            if(resultList.size() == 0){
                throw new QueryException(QueryException.QueryExceptionEnum.DATA_NOT_EXIST_EXCEPTION);
            }
            result.put("legal_dishonest_persons_subject_to_enforcement",resultList);
            return result;
        }else if(targetEntity instanceof qyxx_baxxEntity){
            QueryWrapper<qyxx_baxxEntity> queryWrapper = new QueryWrapper<>();
            //参数为表中的列名，要查询的条件 相当于 WHERE name = name
            queryWrapper.eq("name", request);
            List<qyxx_baxxEntity> resultList = qyxx_baxxMapper.selectList(queryWrapper);
            if(resultList.size() == 0){
                throw new QueryException(QueryException.QueryExceptionEnum.DATA_NOT_EXIST_EXCEPTION);
            }
            result.put("qyxx_baxx",resultList);
            return result;
        }else if(targetEntity instanceof qyxx_fzjg_mergeEntity){
            QueryWrapper<qyxx_fzjg_mergeEntity> queryWrapper = new QueryWrapper<>();
            //参数为表中的列名，要查询的条件 相当于 WHERE name = name
            queryWrapper.eq("company_name", request);
            List<qyxx_fzjg_mergeEntity> resultList = qyxx_fzjg_mergeMapper.selectList(queryWrapper);
            if(resultList.size() == 0){
                throw new QueryException(QueryException.QueryExceptionEnum.DATA_NOT_EXIST_EXCEPTION);
            }
            result.put("qyxx_fzjg_merge",resultList);
            return result;
        }else if(targetEntity instanceof qyxx_gdxxEntity){
            QueryWrapper<qyxx_gdxxEntity> queryWrapper = new QueryWrapper<>();
            //参数为表中的列名，要查询的条件 相当于 WHERE name = name
            queryWrapper.eq("shareholder_name", request);
            List<qyxx_gdxxEntity> resultList = qyxx_gdxxMapper.selectList(queryWrapper);
            if(resultList.size() == 0){
                throw new QueryException(QueryException.QueryExceptionEnum.DATA_NOT_EXIST_EXCEPTION);
            }
            result.put("qyxx_gdxx",resultList);
            return result;
        }else if(targetEntity instanceof qyxx_jqka_cwzb_xjllEntity){
            QueryWrapper<qyxx_jqka_cwzb_xjllEntity> queryWrapper = new QueryWrapper<>();
            //参数为表中的列名，要查询的条件 相当于 WHERE name = name
            queryWrapper.eq("company_name", request);
            List<qyxx_jqka_cwzb_xjllEntity> resultList = qyxx_jqka_cwzb_xjllMapper.selectList(queryWrapper);
            if(resultList.size() == 0){
                throw new QueryException(QueryException.QueryExceptionEnum.DATA_NOT_EXIST_EXCEPTION);
            }
            result.put("qyxx_jqka_cwzb_xjll",resultList);
            return result;
        }else if(targetEntity instanceof qyxx_jqka_cwzb_zcfzEntity){
            QueryWrapper<qyxx_jqka_cwzb_zcfzEntity> queryWrapper = new QueryWrapper<>();
            //参数为表中的列名，要查询的条件 相当于 WHERE name = name
            queryWrapper.eq("company_name", request);
            List<qyxx_jqka_cwzb_zcfzEntity> resultList = qyxx_jqka_cwzb_zcfzMapper.selectList(queryWrapper);
            if(resultList.size() == 0){
                throw new QueryException(QueryException.QueryExceptionEnum.DATA_NOT_EXIST_EXCEPTION);
            }
            result.put("qyxx_jqka_cwzb_zcfz",resultList);
            return result;
        }else if(targetEntity instanceof qyxx_jqka_ipo_fxxgEntity){
            QueryWrapper<qyxx_jqka_ipo_fxxgEntity> queryWrapper = new QueryWrapper<>();
            //参数为表中的列名，要查询的条件 相当于 WHERE name = name
            queryWrapper.eq("company_name", request);
            List<qyxx_jqka_ipo_fxxgEntity> resultList = qyxx_jqka_ipo_fxxgMapper.selectList(queryWrapper);
            if(resultList.size() == 0){
                throw new QueryException(QueryException.QueryExceptionEnum.DATA_NOT_EXIST_EXCEPTION);
            }
            result.put("qyxx_jqka_ipo_fxxg",resultList);
            return result;
        }else if(targetEntity instanceof qyxx_jqka_cwzb_zhsyEntity){
            QueryWrapper<qyxx_jqka_cwzb_zhsyEntity> queryWrapper = new QueryWrapper<>();
            //参数为表中的列名，要查询的条件 相当于 WHERE name = name
            queryWrapper.eq("company_name", request);
            List<qyxx_jqka_cwzb_zhsyEntity> resultList = qyxx_jqka_cwzb_zhsyMapper.selectList(queryWrapper);
            if(resultList.size() == 0){
                throw new QueryException(QueryException.QueryExceptionEnum.DATA_NOT_EXIST_EXCEPTION);
            }
            result.put("qyxx_jqka_cwzb_zhsy",resultList);
            return result;
        }else if(targetEntity instanceof qyxx_jqka_cwzb_zhzbEntity){
            QueryWrapper<qyxx_jqka_cwzb_zhzbEntity> queryWrapper = new QueryWrapper<>();
            //参数为表中的列名，要查询的条件 相当于 WHERE name = name
            queryWrapper.eq("company_name", request);
            List<qyxx_jqka_cwzb_zhzbEntity> resultList = qyxx_jqka_cwzb_zhzbMapper.selectList(queryWrapper);
            if(resultList.size() == 0){
                throw new QueryException(QueryException.QueryExceptionEnum.DATA_NOT_EXIST_EXCEPTION);
            }
            result.put("qyxx_jqka_cwzb_zhzb",resultList);
            return result;
        }else if(targetEntity instanceof qyxx_jqka_ipo_basicEntity){
            QueryWrapper<qyxx_jqka_ipo_basicEntity> queryWrapper = new QueryWrapper<>();
            //参数为表中的列名，要查询的条件 相当于 WHERE name = name
            queryWrapper.eq("company_name", request);
            List<qyxx_jqka_ipo_basicEntity> resultList = qyxx_jqka_ipo_basicMapper.selectList(queryWrapper);
            if(resultList.size() == 0){
                throw new QueryException(QueryException.QueryExceptionEnum.DATA_NOT_EXIST_EXCEPTION);
            }
            result.put("qyxx_jqka_ipo_basic",resultList);
            return result;
        }else if(targetEntity instanceof qyxx_sharesimpawnEntity){
            QueryWrapper<qyxx_sharesimpawnEntity> queryWrapper = new QueryWrapper<>();
            //参数为表中的列名，要查询的条件 相当于 WHERE name = name
            queryWrapper.eq("company_name", request);
            List<qyxx_sharesimpawnEntity> resultList = qyxx_sharesimpawnMapper.selectList(queryWrapper);
            if(resultList.size() == 0){
                throw new QueryException(QueryException.QueryExceptionEnum.DATA_NOT_EXIST_EXCEPTION);
            }
            result.put("qyxx_sharesimpawn",resultList);
            return result;
        }else if(targetEntity instanceof qyxx_wanfang_zhuanliEntity){
            QueryWrapper<qyxx_wanfang_zhuanliEntity> queryWrapper = new QueryWrapper<>();
            //参数为表中的列名，要查询的条件 相当于 WHERE name = name
            queryWrapper.eq("company_name", request);
            List<qyxx_wanfang_zhuanliEntity> resultList = qyxx_wanfang_zhuanliMapper.selectList(queryWrapper);
            if(resultList.size() == 0){
                throw new QueryException(QueryException.QueryExceptionEnum.DATA_NOT_EXIST_EXCEPTION);
            }
            result.put("qyxx_wanfang_zhuanli",resultList);
            return result;
        }else if(targetEntity instanceof risk_punishmentEntity){
            QueryWrapper<risk_punishmentEntity> queryWrapper = new QueryWrapper<>();
            //参数为表中的列名，要查询的条件 相当于 WHERE name = name
            queryWrapper.eq("company", request);
            List<risk_punishmentEntity> resultList = risk_punishmentMapper.selectList(queryWrapper);
            if(resultList.size() == 0){
                throw new QueryException(QueryException.QueryExceptionEnum.DATA_NOT_EXIST_EXCEPTION);
            }
            result.put("risk_punishment",resultList);
            return result;
        }else if(targetEntity instanceof risk_tax_owedEntity){
            QueryWrapper<risk_tax_owedEntity> queryWrapper = new QueryWrapper<>();
            //参数为表中的列名，要查询的条件 相当于 WHERE name = name
            queryWrapper.eq("company_name", request);
            List<risk_tax_owedEntity> resultList = risk_tax_owedMapper.selectList(queryWrapper);
            if(resultList.size() == 0){
                throw new QueryException(QueryException.QueryExceptionEnum.DATA_NOT_EXIST_EXCEPTION);
            }
            result.put("risk_tax_owed",resultList);
            return result;
        }else if(targetEntity instanceof xgxx_shangbiaoEntity){
            QueryWrapper<xgxx_shangbiaoEntity> queryWrapper = new QueryWrapper<>();
            //参数为表中的列名，要查询的条件 相当于 WHERE name = name
            queryWrapper.eq("applicant_name", request);
            List<xgxx_shangbiaoEntity> resultList = xgxx_shangbiaoMapper.selectList(queryWrapper);
            if(resultList.size() == 0){
                throw new QueryException(QueryException.QueryExceptionEnum.DATA_NOT_EXIST_EXCEPTION);
            }
            result.put("xgxx_shangbiao",resultList);
            return result;
        }else {
            throw new QueryException(QueryException.QueryExceptionEnum.ILLEGAL_PARAM_EXCEPTION).newInstance("不能为空");
        }
    }

    @Override
    public Map queryJoinTableData(String companyId) {
        QueryWrapper<companyEntity> queryWrapper = new QueryWrapper<>();
        //参数为表中的列名，要查询的条件 相当于 WHERE name = name
        queryWrapper.eq("company_id", companyId);
        List<companyEntity> resultList = companyMapper.selectList(queryWrapper);
        if(resultList.size() == 0){
            throw new QueryException(QueryException.QueryExceptionEnum.DATA_NOT_EXIST_EXCEPTION);
        }
        Map<String,Object> result = new HashMap<>();
        result.put("company",resultList);
        QueryWrapper<company_listedcompany_toptencurrentshareholdersEntity> query1Wrapper = new QueryWrapper<>();
        //参数为表中的列名，要查询的条件 相当于 WHERE name = name
        query1Wrapper.eq("company_id", resultList.get(0).getCompanyId());
        List<company_listedcompany_toptencurrentshareholdersEntity> resultList1 = companyListedcompanyToptencurrentshareholdersMapper.selectList(query1Wrapper);
        result.put("company_listedcompany_toptencurrentshareholders", resultList1);
        return result;
    }

}
